//
//  StoreHomeCollectionReusableView.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/11/3.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "StoreHomeCollectionReusableView.h"
#import "UIImageView+LoadwebImage.h"
@interface StoreHomeCollectionReusableView()

@property(nonatomic,strong)UIImageView *headImageView;

@property(nonatomic,strong)UILabel *nameLabel;

@end

@implementation StoreHomeCollectionReusableView


-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        
        self.backgroundColor=TBColorNavBar;
        
        self.headImageView=[[UIImageView alloc]initWithFrame:CGRectMake((SCREEN_WIDTH-80)/2.0, 20, 80, 80)];
        
        self.headImageView.layer.cornerRadius=40;
        
        self.headImageView.layer.masksToBounds=YES;
        
        self.headImageView.contentMode=UIViewContentModeScaleAspectFill;
        
        [self addSubview:self.headImageView];
        
        self.nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(80, self.headImageView.bottom+10, SCREEN_WIDTH-160, 41)];
        
        
        self.nameLabel.textColor=[UIColor whiteColor];
        
        self.nameLabel.numberOfLines=2;
        
        self.nameLabel.textAlignment=NSTextAlignmentCenter;
        
        self.nameLabel.font=[UIFont systemFontOfSize:17];
        
        [self addSubview:self.nameLabel];
        
        
    }
    
    return self;
}


-(void)setImageUrl:(NSString *)imageUrl
{
    _imageUrl=imageUrl;
    
    [self.headImageView LoadWebImageWithName:imageUrl andIsOrgin:NO];
    
}

-(void)setName:(NSString *)name
{
    _name=name;
    
    self.nameLabel.text=name;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
